package be.fomp.jeve.application.data.standard.corporationsheet;

import org.jdom.Document;
import org.jdom.Element;

import be.fomp.jeve.application.data.AbstractResultImpl;
import be.fomp.jeve.application.data.standard.CorporationSheet;
import be.fomp.jeve.core.exceptions.JEveException;

public class CorporationSheetImpl extends AbstractResultImpl implements	CorporationSheet {
	static final long serialVersionUID = 1L;
	
	private Integer corporationID;
	private String corporationName;
	private String ticker;
	private Integer ceoID;
	private String ceoName;
	private Integer stationID;
	private String stationName;
	private String description;
	private String url;
	private Integer allianceID;
	private String allianceName;
	private Double taxRate;
	private Integer memberCount;
	private Integer shares;
	private Logo logo;

	public CorporationSheetImpl(Document xmlDocument) throws JEveException {
		super(xmlDocument);

		Element root = xmlDocument.getRootElement();
		Element result = root.getChild("result");

		this.corporationName = result.getChildText("corporationName");
		this.ticker = result.getChildText("ticker");

		this.ceoID = Integer.parseInt(result.getChildText("ceoID"));
		this.ceoName = result.getChildText("ceoName");

		this.stationID = Integer.parseInt(result.getChildText("stationID"));
		this.stationName = result.getChildText("stationName");
		this.description = result.getChildText("description");
		this.url = result.getChildText("url");

		this.allianceID = Integer.parseInt(result.getChildText("allianceID"));
		this.allianceName = result.getChildText("allianceName");

		this.taxRate = Double.parseDouble(result.getChildText("taxRate"));
		this.memberCount = Integer.parseInt(result.getChildText("memberCount"));
		this.shares = Integer.parseInt(result.getChildText("shares"));

		this.logo = new LogoImpl(result.getChild("logo"));
	}

	public Integer getCorporationID()  {return this.corporationID;}
	public String getCorporationName() {return this.corporationName;}

	public String getTicker() {return this.ticker;}

	public Integer getCeoID()   {return this.ceoID;}
	public String  getCeoName() {return this.ceoName;}

	public Integer getStationID()   {return this.stationID;}
	public String  getStationName() {return this.stationName;}

	public String getDescription() {return this.description;}

	public String getUrl() {return this.url;}

	public Integer getAllianceID()   {return this.allianceID;}
	public String  getAllianceName() {return this.allianceName;}

	public Double getTaxRate() {return this.taxRate;}

	public Integer getMemberCount() {return this.memberCount;}

	public Integer getShares() {return this.shares;}

	public Logo getLogo() { return this.logo; }

}
